Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: OpenDoc Class Reference /
Part 1 - Classes and Methods / ODDragAndDrop


ShowPasteAsDialog

Mac OS

The ShowPasteAsDialog method displays the Paste As dialog box and sets the appropriate dialog items according to the input parameters.

ODBoolean ShowPasteAsDialog (
                     in ODBoolean canPasteLink, 
                     in ODPasteAsMergeSetting mergeSetting, 
                     in ODFacet facet, 
                     in ODTypeToken viewType, 
                     in ODStorageUnit contentSU,
                     out ODPasteAsResult theResult);
canPasteLink
kODTrue if the destination part allows a link to be created, otherwise kODFalse.
mergeSetting
A value indicating whether embedding and merging are supported; determines the initial setting for the At the Destination radio buttons.
facet
A reference to the facet in which the drop is to occur.
viewType
A tokenized string representing the initial setting for the view type of the embedded part (if embedding is chosen).
contentSU
A reference to the content storage unit for the drag item being pasted.
theResult
A structure reflecting the user's selections in the Paste As dialog box.
return value
kODTrue if the user clicked OK to leave the Paste As dialog box, otherwise kODFalse.
DISCUSSION
If your part is the destination of a drop and the user requests a Paste As operation, you can call this method to display the Paste As dialog box for a particular drag item. On the Mac OS platform, whenever your part is the destination of a drop, you should call the GetDragAttributes method of the drag-and-drop object; if the kODDropIsPasteAs flag is set in the drag attributes, you must call this method.

If the canPasteLink parameter is true, the content storage unit contains a link specification, and the draft permissions allow writing, then the Paste with Link checkbox is enabled. If that checkbox is enabled, its initial setting is checked.

The mergeSetting parameter specifies which At the Destination radio button (Merge with Contents or Embed As) is initially selected in the Paste As dialog box and whether the other button is available. It must be one of the following:

The viewType parameter must be the tokenized form of one of the view-type constants (kODViewAsFrame, kODViewAsLargeIcon, kODViewAsSmallIcon, or kODViewAsThumbnail). You can call the session object's Tokenize method to obtain a token corresponding to one of these constants.

If the user clicks OK, this method returns true and sets the fields of the output parameter, theResult, to indicate the selections the user made in the Paste As dialog box; in this case, you must deallocate the non-null selectedKind, translateKind, and editor fields of the theResult structure when you are finished using them.

If the user cancels the dialog box, this method returns false and you do not need to take any further action.

EXCEPTIONS
kODErrIllegalNullStorageUnitInput
The ContentSU parameter is null.
kODErrNullFacetInput
The facet parameter is null.
kODErrNullPasteAsResultInput
The theResult parameter is null.
SEE ALSO
The ODPasteAsResult type (page 918).
The ODTypeToken type (page 877).
The ODDragAndDrop::GetDragAttributes method (page 191).
The ODSession::Tokenize method (page 622).
"Handling the Paste As Dialog Box" on page 337 in OpenDoc Programmer's Guide.
"Drag Attributes and the Drop Method" on page 364 in OpenDoc Programmer's Guide.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
17 JUL 1996




Navigation graphic, see text links

Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help